﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SceneTester.Scenes
{
    public abstract class Scene
    {
        protected Graphics Graphics;
        protected Camera Camera;

        public delegate void OnExit();

        public OnExit OnExitEvent;

        public Scene(Graphics g, Camera camera)
        {
            this.Graphics = g;
            this.Camera = camera;
            OnExitEvent += Decompose;

        }

        /// <summary>
        /// Loads the scene (ie prepares it to play). 
        /// Can call back its progress (determined in the individual scenes)
        /// </summary>
        /// <param name="Progress"></param>
        public abstract void Load(Action<int> ProgressCallback);

        public abstract void Play();

        /// <summary>
        /// Releases ressources kept by this scene and unregisters events
        /// </summary>
        public abstract void Decompose();
    }
}
